<!--南丁格尔玫瑰图-->
<!--招聘时常用的公司标签-->
<template>
        <div id="main" style="width:1000px;height:600px;margin: 10px auto;"></div>
</template>
<script>
        import request from "../utils/request";

        const echarts = require('echarts');

        export default{
                data () {
                        return {
                                search: '',
                                currentPage: 1,
                                pageSize: 2000,
                                total: 0,
                                data0: [],
                                links: [],
                        };
                },
                created() {

                },
                methods: {
                        initCharts () {
                                var chartDom = document.getElementById('main');
                                var myChart = echarts.init(chartDom);
                                var option;


                                request.get("/sojob/tags",{ // 请求/sojob/tags接口
                                        params: {
                                                pageNum: this.currentPage,
                                                pageSize: this.pageSize,
                                                search: this.search
                                        }
                                }).then(res=>{
                                        // console.log(res);

                                        this.data0=res.data.records;
                                        // console.log(this.data0)

                                        option = {
                                                title: {
                                                        text: '公司招聘时常用的标签',
                                                        subtext: '数据截止至: 2021.08.13'
                                                },
                                                tooltip: {
                                                        trigger: 'item'
                                                },
                                                toolbox: {  // 显示保存图片的按钮
                                                        show: true,
                                                        orient: 'horizontal',
                                                        top: 10,
                                                        right: 20,
                                                        feature: {
                                                                saveAsImage: {}
                                                        }
                                                },
                                                legend: {
                                                        bottom: '0%',
                                                        left: 'center'
                                                },
                                                series: [
                                                        {
                                                                name: '常用标签',
                                                                type: 'pie',
                                                                radius: ['40%', '70%'],
                                                                avoidLabelOverlap: false,
                                                                itemStyle: {
                                                                        borderRadius: 10,
                                                                        borderColor: '#fff',
                                                                        borderWidth: 2
                                                                },
                                                                label: {
                                                                        show: false,
                                                                        position: 'center'
                                                                },
                                                                emphasis: {
                                                                        label: {
                                                                                show: true,
                                                                                fontSize: '40',
                                                                                fontWeight: 'bold'
                                                                        }
                                                                },
                                                                labelLine: {
                                                                        show: false
                                                                },
                                                                data: this.data0
                                                        }
                                                ]
                                        };

                                        option && myChart.setOption(option);

                                })

                        },
                },

                mounted () {
                        this.initCharts();
                        console.log("mounted")
                }
        }
</script>

<style scoped>

</style>